<?php



class CreditMemoMapBuilder implements MapBuilder {

	
	const CLASS_NAME = 'lib.model.map.CreditMemoMapBuilder';

	
	private $dbMap;

	
	public function isBuilt()
	{
		return ($this->dbMap !== null);
	}

	
	public function getDatabaseMap()
	{
		return $this->dbMap;
	}

	
	public function doBuild()
	{
		$this->dbMap = Propel::getDatabaseMap(CreditMemoPeer::DATABASE_NAME);

		$tMap = $this->dbMap->addTable(CreditMemoPeer::TABLE_NAME);
		$tMap->setPhpName('CreditMemo');
		$tMap->setClassname('CreditMemo');

		$tMap->setUseIdGenerator(false);

		$tMap->addForeignPrimaryKey('CREDIT_IDEN', 'CreditIden', 'VARCHAR' , 'document', 'DOCUMENT_IDEN', true, 20);

		$tMap->addForeignKey('CUSTOMER_IDEN', 'CustomerIden', 'VARCHAR', 'account_customer', 'CONTACT_IDEN', true, 18);

		$tMap->addForeignKey('CREDIT_TYPE', 'CreditType', 'VARCHAR', 'list_document_types', 'TYPEID', true, 5);

		$tMap->addColumn('CREDIT_NUMBER', 'CreditNumber', 'VARCHAR', true, 20);

		$tMap->addColumn('REMARKS', 'Remarks', 'LONGVARCHAR', true, null);

		$tMap->addForeignKey('INVOICE_IDEN', 'InvoiceIden', 'VARCHAR', 'invoice', 'INVOICE_IDEN', true, 20);

		$tMap->addColumn('AMOUNT', 'Amount', 'DOUBLE', true, null);

		$tMap->addColumn('TAX_CODE', 'TaxCode', 'VARCHAR', true, 20);

	} 
} 